// eslint-disable-next-line
import { UserLayout, BasicLayout, BlankLayout } from '@/layouts'
import { bxAnaalyse } from '@/core/icons'

const RouteView = {
  name: 'RouteView',
  render: h => h('router-view')
}

export const asyncRouterMap = [
  {
    path: '/',
    name: 'default',
    redirect: '/a',
  },
  {
    path: '/a',
    name: 'a',
    redirect: 'a/home/runboard',
    component: BasicLayout,
    meta: { title: 'menu.home' },
    children: [
      {
        path: 'home',
        name: 'home',
        // component: () => import('@/views/dashboard/Analysis'),
        component: () => import('@/views/home/index'),
        meta: { title: '首页', keepAlive: true, icon: 'home',  },
        redirect: 'home/runboard',
        children: [
          {
            path: 'runboard',
            name: 'runboard',
            component: () => import('@/views/home/BoardPage/RunBoard'),
            meta: { title: '经营看板', keepAlive: false, icon: ''}
          },
          {
            path: 'DataBoard',
            name: 'DataBoard',
            component: () => import('@/views/home/BoardPage/DataBoard/DataBoard'),
            meta: { title: '数据看板', keepAlive: false, icon: ''}
          },
          {
            path: 'OfficeBoard',
            name: 'OfficeBoard',
            component: () => import('@/views/home/BoardPage/OfficeBoard/index'),
            meta: { title: '办公看板', keepAlive: false, icon: ''}
          },
          {
            path: 'AlarmBoard',
            name: 'AlarmBoard',
            component: () => import('@/views/home/BoardPage/AlarmBoard/AlarmBoard'),
            meta: { title: '报警看板', keepAlive: false, icon: ''}
          },
          {
            path: 'videoBoard',
            name: 'videoBoard',
            component: () => import('@/views/home/BoardPage/videoBoard'),
            meta: { title: '视屏看板', keepAlive: false, icon: ''}
          },
          // {
          //   path: 'productboard',
          //   name: 'productboard',
          //   component: () => import('@/views/home/BoardPage/ProductBoard'),
          //   meta: { title: '生产看板', keepAlive: false, icon: ''}
          // },
          // {
          //   path: 'isuueboard',
          //   name: 'isuueboard',
          //   component: () => import('@/views/home/BoardPage/IsuueBoard'),
          //   meta: { title: '发料看板', keepAlive: false, icon: ''}
          // },
          // {
          //   path: 'reciveboard',
          //   name: 'reciveboard',
          //   component: () => import('@/views/home/BoardPage/ReciveBoard'),
          //   meta: { title: '收料看板', keepAlive: false, icon: ''}
          // },
          {
            path: 'financeboard',
            name: 'financeboard',
            component: () => import('@/views/home/BoardPage/FinanceBoard/index'),
            meta: { title: '财务看板', keepAlive: false, icon: ''}
          },
          {
            path: 'financeboard2',
            name: 'financeboard2',
            component: () => import('@/views/home/BoardPage/FinanceBoard2/index'),
            meta: { title: '拖动Dom', keepAlive: false, icon: ''}
          },

        ]
      },
       //组织管理
      {
        path: 'organization',
        name: 'organization',
        redirect: 'organization/a1',
        component: () => import('@/views/organization/organizationData'),
        meta: { title: '组织管理', keepAlive: false,icon: 'appstore',   },
        children: [
          {
            path: 'a1',
            name: 'a1',
            component: () => import('@/views/dashboard/Workplace'),
            meta: { title: '组织管理1', keepAlive: true }
          },
          {
            path: 'b1',
            name: 'b1',
            component: () => import('@/views/dashboard/Workplace'),
            meta: { title: '组织管理2', keepAlive: true }
          },
          {
            path: 'c1',
            name: 'c1',
            component: () => import('@/views/dashboard/Workplace'),
            meta: { title: '组织管理2', keepAlive: true }
          },
        ]
      },

        //员工管理
      // {
      //     path: 'staff',
      //     name: 'staff',
      //     component: () => import('@/views/staff/staffConfig'),
      //     meta: { title: '员工管理', keepAlive: false,icon: 'user',   }
      // },

      {
        path: 'roleData',
        name: 'roleData',
        component: () => import('@/views/role/roleData'),
        meta: { title: '角色管理', keepAlive: false, icon: 'usergroup-add', },
      },

      // 角色看板
      {
        path: 'roleBoard',
        name: 'roleBoard',
        hidden: true,
        hideChildrenInMenu: true, 
        component: () => import('@/views/role/roleBoard'),
        meta: { title: '角色看板', keepAlive: false,   }
      },
     

      //空间管理
      {
        path: 'spaceConfig',
        name: 'space',
        component: () => import('@/views/space/spaceConfig'),
        meta: { title: '空间管理', keepAlive: true, icon: 'codepen',  },
      },
      

      //业务系统
      {
        path: 'businessSym',
        name: 'business',
        component: () => import('@/views/business/businessSym'),
        meta: { title: '业务系统', keepAlive: true, icon: 'medicine-box',  },
      },

      //资源管理
      {
        path: 'resource',
        name: 'resource',
        component: () => import('@/views/resource/resourceConfig'),
        meta: { title: '资源管理', keepAlive: true, icon: 'project',  },
      },

       //团队协作
      {
        path: 'team',
        name: 'team',
        component: () => import('@/views/team/teamwork'),
        meta: { title: '团队协作', keepAlive: true, icon: 'team',  },
      },

       //数据管理
       {
        path: 'dataConfig',
        name: 'data',
        component: () => import('@/views/data/dataConfig'),
        meta: { title: '数据管理', keepAlive: true, icon: 'line-chart',  },
      },
    ]
  },
  {
    path: '/b',
    name: 'b',
    redirect: 'b/dataConfig1',
    component: BasicLayout,
    meta: { title: 'menu.home' },
    children: [
      //数据管理
      {
        path: 'dataConfig1',
        name: 'dataConfig1',
        component: () => import('@/views/data/dataConfig'),
        meta: { title: '数据管理1', keepAlive: true, icon: 'line-chart',  },
      },
    ]
  },
  {
    path: '/c',
    name: 'c',
    redirect: 'c/dataConfig1',
    component: BasicLayout,
    meta: { title: 'menu.home' },
    children: [
      //数据管理
      {
        path: 'dataConfig1',
        name: 'dataConfig1',
        component: () => import('@/views/data/dataConfig'),
        meta: { title: '11111', keepAlive: true, icon: 'line-chart',  },
      },
    ]
  },
  {
    path: '*',
    redirect: '/404',
    hidden: true
  }
]


/**
 * 基础路由
 * @type { *[] }
 */
export const constantRouterMap = [
  {
    path: '/user',
    component: UserLayout,
    redirect: '/user/login',
    hidden: true,
    children: [
      {
        path: 'login',
        name: 'login',
        component: () => import(/* webpackChunkName: "user" */ '@/views/user/Login')
      },
      {
        path: 'register',
        name: 'register',
        component: () => import(/* webpackChunkName: "user" */ '@/views/user/Register')
      },
      {
        path: 'register-result',
        name: 'registerResult',
        component: () => import(/* webpackChunkName: "user" */ '@/views/user/RegisterResult')
      },
      {
        path: 'recover',
        name: 'recover',
        component: undefined
      }
    ]
  },
  {
    path: '/404',
    component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/404')
  }
]
